﻿using System.Collections;
using System.Collections.Generic;

using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;

#endif

 

public class PButtonAttribute : LabelAttribute
{
    
    public PButtonAttribute(string label, string conditionalSourceField) : base(label, conditionalSourceField)
    {
    }
    public PButtonAttribute(string label) : base(label)
    {
    }

   
}
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(PButtonAttribute))]
public class ButtonAttributeDrawer : ConditionalHidePropertyDrawer
{

    public override float BaseGetPropertyHeight(SerializedProperty property, GUIContent label)
    {
        return EditorGUIUtility.singleLineHeight+5;
    }
    public override void DrawPropertyItem(LabelAttribute condHAtt, Rect position, SerializedProperty property, GUIContent label)
    {
        Rect _rect = position;
        _rect.height = EditorGUIUtility.singleLineHeight ;
        property.boolValue = GUI.Button(_rect, label);
    }
    

}
#endif
